var calculator = new Vue({
			el:"#calculator",
			data:{
				exp: "",
				arr:[
					["(", ")", "%", "C"],
					["7", "8", "9", "/"],
					["4", "5", "6", "*"],
					["1", "2", "3", "-"],
					["0", ".", "=", "+"],
				],
			},
			methods:{
				//键盘按下的触发的方法
				getkey:function(event) {
					
					switch(event.keyCode) {
						case 67: //C
							this.exp = '';
							event.preventDefault(); //阻止C字母输入到框中
							break;
						case 13: //enter
								var result = ''; 
								try{
									eval(this.exp+"");
								}catch(e){				
									result = "ERROR";
								}finally{
									this.exp =  result?result:(this.exp + " = "+ eval(this.exp+""));
								}break;
					}
				},
				//鼠标按下触发的方法
				getbtn:function(e) {
					switch(e.target.innerText) {
						case "C": 
							this.exp = '';break;
						case "=": 
								var result ;
								try{
									eval(this.exp+"");
								}catch(e){				
									result = "ERROR";
								}finally{
									this.exp =  result?result:(this.exp + " = "+ eval(this.exp+""));
								}break;
						default: 
								this.exp += e.target.innerText;
								break;
								
					}
				},
			}
		})